package com.kayt.cyberBar.company.business.entity.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.*;

import org.codehaus.jackson.annotate.JsonIgnore;


/**
 * The persistent class for the b_company_material_base database table.
 * 
 */
@Entity
@Table(name="b_company_material_base")
@NamedQuery(name="BCompanyMaterialBase.findAll", query="SELECT b FROM BCompanyMaterialBase b")
public class BCompanyMaterialBase implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long id;
	private String statusCode;
	private String code;
	private String createTime;
	private String name;
	private String typeCode;
	private String searchKey;
	private String sequence;
	private String updateTime;
	private String shelfLife;
	private String standard;
	private String weight;
	private String size;
	
	private BCompanyBaseUnitMap unitMap;
	
	private List<BCompanyMaterialBaseDesc> descList = new ArrayList<>();
	private List<BCompanyMaterialBasePic> picList = new ArrayList<>();
	private List<BCompanyMaterialBasePrice> priceList = new ArrayList<>();
	private List<BCompanyMaterialBaseRank> rankList = new ArrayList<>();
	private List<BCompanyMaterialBaseSale> saleList = new ArrayList<>();
	private List<BCompanyMaterialBaseStock> stockList = new ArrayList<>();
	private List<BCompanyMaterialBaseTag> tagList = new ArrayList<>();
	private List<BCompanyMaterialBaseType> typeList = new ArrayList<>();
	private List<BCompanyMaterialBaseTotal> totalList = new ArrayList<>();
	private List<BCompanyMaterialBaseCost> costList = new ArrayList<>();

	public BCompanyMaterialBase() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@Column(name="STATUS_CODE")
	public String getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}


	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}


	@Column(name="CREATE_TIME")
	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}


	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}


	@Column(name="SEARCH_KEY")
	public String getSearchKey() {
		return this.searchKey;
	}

	public void setSearchKey(String searchKey) {
		this.searchKey = searchKey;
	}

	@Column(name="TYPE_CODE")
	public String getTypeCode() {
		return typeCode;
	}


	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}


	public String getSequence() {
		return this.sequence;
	}

	public void setSequence(String sequence) {
		this.sequence = sequence;
	}


	@Column(name="UPDATE_TIME")
	public String getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name="SHELF_LIFE")
	public String getShelfLife() {
		return shelfLife;
	}


	public void setShelfLife(String shelfLife) {
		this.shelfLife = shelfLife;
	}


	public String getStandard() {
		return standard;
	}


	public void setStandard(String standard) {
		this.standard = standard;
	}


	public String getWeight() {
		return weight;
	}


	public void setWeight(String weight) {
		this.weight = weight;
	}


	public String getSize() {
		return size;
	}


	public void setSize(String size) {
		this.size = size;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseDesc.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseDesc> getDescList() {
		return descList;
	}


	public void setDescList(List<BCompanyMaterialBaseDesc> descList) {
		this.descList = descList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBasePic.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBasePic> getPicList() {
		return picList;
	}


	public void setPicList(List<BCompanyMaterialBasePic> picList) {
		this.picList = picList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBasePrice.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	@OrderBy("priceCode desc")
	public List<BCompanyMaterialBasePrice> getPriceList() {
		return priceList;
	}


	public void setPriceList(List<BCompanyMaterialBasePrice> priceList) {
		this.priceList = priceList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseRank.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseRank> getRankList() {
		return rankList;
	}


	public void setRankList(List<BCompanyMaterialBaseRank> rankList) {
		this.rankList = rankList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseSale.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseSale> getSaleList() {
		return saleList;
	}


	public void setSaleList(List<BCompanyMaterialBaseSale> saleList) {
		this.saleList = saleList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseStock.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseStock> getStockList() {
		return stockList;
	}


	public void setStockList(List<BCompanyMaterialBaseStock> stockList) {
		this.stockList = stockList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseTag.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseTag> getTagList() {
		return tagList;
	}


	public void setTagList(List<BCompanyMaterialBaseTag> tagList) {
		this.tagList = tagList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseType.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseType> getTypeList() {
		return typeList;
	}


	public void setTypeList(List<BCompanyMaterialBaseType> typeList) {
		this.typeList = typeList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseTotal.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseTotal> getTotalList() {
		return totalList;
	}


	public void setTotalList(List<BCompanyMaterialBaseTotal> totalList) {
		this.totalList = totalList;
	}


	@OneToMany(targetEntity = BCompanyMaterialBaseCost.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "mate")
	public List<BCompanyMaterialBaseCost> getCostList() {
		return costList;
	}


	public void setCostList(List<BCompanyMaterialBaseCost> costList) {
		this.costList = costList;
	}


	@OneToOne(targetEntity = BCompanyBaseUnitMap.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
	@JoinColumn(name="CODE", referencedColumnName="ITEM_CODE", nullable = false, insertable=false, updatable=false)
	@JsonIgnore
	public BCompanyBaseUnitMap getUnitMap() {
		return unitMap;
	}


	public void setUnitMap(BCompanyBaseUnitMap unitMap) {
		this.unitMap = unitMap;
	}

}